package String;

public class ReverseString344 {
    public void reverseString(char[] s){
        if(s.length == 0 || s.length ==1){
            System.out.println(s);
        }
        int i = 0;
        int j = s.length-1;
        while(i < j){
//            char temp = s[i];
//            s[i] = s[j];
//            s[j] = temp;
            s[i] ^= s[j];
            s[j] ^= s[i];
            s[i] ^= s[j];
            i++;
            j--;
        }
        System.out.println(s);
    }
}
